home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14556 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: ix.netcom.com!news
  2. From: jlilley@ix.netcom.com (John Lilley)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Is it OK to delete const *type pointers?
  5. Date: 30 Mar 1996 23:41:16 GMT
  6. Organization: Netcom
  7. Message-ID: <4jkgqs$i4b@dfw-ixnews6.ix.netcom.com>
  8. References: <4jhjub$fpc@mag1.magmacom.com>
  9. NNTP-Posting-Host: den-co15-25.ix.netcom.com
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-NETCOM-Date: Sat Mar 30  5:41:16 PM CST 1996
  13. X-Newsreader: WinVN 0.99.7
  14.  
  15. In article <4jhjub$fpc@mag1.magmacom.com>, ezust@mag1.magmacom.com says...
  16. >Some compilers let me do this, others do not. What I would like to know is,
  17. >what does Stroustrup think? I.e. is it written somewhere in the ARM (I checked
  18. >but can't find it) or in the draft standard? If somoene could e-mail me a
  19. >quote or a pointer to a place where I can read where it says such a thing
  20. >should or should not be allowed, I would appreciate it!
  21. >
  22. >const int* array= new int[30];
  23. >delete[] array;
  24.  
  25. The ARM says that it is valid to call the destructor for a const object.
  26. This implies to me that it should also be legal to delete it.  However,
  27. I cannot find that explicitly stated.
  28.  
  29. john lilley
  30.  
  31.